package com.smartcat.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smartcat.dao.TranslateDataMapper;
import com.smartcat.dao.UserFunctionMapMapper;
import com.smartcat.model.TranslateData;
import com.smartcat.model.UserFunctionMap;
import com.smartcat.model.UserFunctionMapKey;
import com.smartcat.service.SelfService;

@Service
public class SelfServiceImpl implements SelfService{

	private UserFunctionMapMapper userFunctionMapMapper;
	private TranslateDataMapper translateDataMapper;
	
	@Autowired
	public void setUserFunctionMapMapper(UserFunctionMapMapper userFunctionMapMapper) {
		this.userFunctionMapMapper = userFunctionMapMapper;
	}

	@Autowired
	public void setTranslateDataInfoMapper(TranslateDataMapper translateDataMapper) {
		this.translateDataMapper = translateDataMapper;
	}



	@Override
	public void saveUserFunctionMap(UserFunctionMap userFunctionMap) {
		userFunctionMapMapper.insert(userFunctionMap);
		
	}


	@Override
	public void deleteUserFunctionMap(UserFunctionMapKey userFunctionMapKey) {
		userFunctionMapMapper.deleteByPrimaryKey(userFunctionMapKey);	
	}


	@Override
	public void updateTranslateData(TranslateData translateDataInfo) {
		
		translateDataMapper.updateByPrimaryKeySelective(translateDataInfo);
	}

	@Override
	public void deleteTranslateData(Integer keyId) {
		translateDataMapper.deleteByPrimaryKey(keyId);
	}

	
}
